
<div class="chart-revenus-day clear">
    <h1><span><?= $arr["Ngay"]; ?></span></h1>
    <span class="close-chart"></span>
    <?php
    if (count($arr["Data"]) == 0) {
        ?>
        <div class="no-record"><?= $LANG["label"]["NODATA"]; ?> !</div>
        <?php
    } else {
        ?>
        <div class="chart-pie-area haft">
            <script>
                var gr = generateString('ABCDEFGHILKLMNOPQRSTUVWXYZ0123456789', 4);
            </script>
            <div class="chart luotchoi">
                <canvas id="chartLuotChoi" width="180" height="180"></canvas>
                <script>
                    var chartLuotChoiNew = 'chartLuotChoi_' + gr;
                    var chartLuotChoi = document.getElementById('chartLuotChoi');
                    chartLuotChoi.setAttribute('id', chartLuotChoiNew);
                </script>
                <div class="description">
                    <h4>
                        <i style="background: #2C99B7"></i>
                        <span class="name">'.<?= $LANG["label"]["NUMBEROFWONGAMES"]; ?>.': </span>
                        <span class="value"><?= $arr["Data"]["Solanthang"]; ?></span>
                    </h4>
                    <h4>
                        <i style="background: #DCDCDC"></i>
                        <span class="name">'.<?= $LANG["label"]["NUMBEROFLOSTGAMES"]; ?>.': </span>
                        <span class="value"><?= $arr["Data"]["Solanthua"]; ?></span>
                    </h4>
                </div>
                <script>
                    var chartData = [
                        {label: "Số lượt Thắng", value: <?= $arr["Data"]["Solanthang"]; ?>, color: "#2C99B7", highlight: "#51B9D6"},
                        {label: "Số lượt Thua", value: <?= $arr["Data"]["Solanthua"]; ?>, color: "#DCDCDC", highlight: "#FFFFFF"}
                    ];
                    var ctx = document.getElementById(chartLuotChoiNew).getContext("2d");
                    new Chart(ctx).Pie(chartData, {
                        segmentStrokeColor: "rgba(255, 255, 255, .5)",
                        segmentStrokeWidth: 3
                    });
                </script>
            </div>
            <div class="caption">
                <?= $LANG["label"]["NUMBEROFBET"]; ?>
            </div>
        </div>
        <div class="chart-pie-area haft">
            <div class="chart tongtienchoi">
                <canvas id="chartTongTienChoi" width="180" height="180"></canvas>
                <script>
                    var chartTongTienChoiNew = 'chartTongTienChoi_' + gr;
                    var chartTongTienChoi = document.getElementById('chartTongTienChoi');
                    chartTongTienChoi.setAttribute('id', chartTongTienChoiNew);
                </script>
                <div class="description">
                    <h4>
                        <i style="background: #2C99B7"></i>
                        <span class="name"><?= $LANG["label"]["WINMONEY"]; ?>: </span>
                        <span class="value"><?= number_format($arr["Data"]["Tienthua"], "0", ",", "."); ?> VNĐ</span>
                    </h4>
                    <h4>
                        <i style="background: #DCDCDC"></i>
                        <span class="name"><?= $LANG["label"]["PAYMENTLOSS"]; ?>: </span>
                        <span class="value"><?= number_format($arr["Data"]["Tienthang"], "0", ",", "."); ?> VNĐ</span>
                    </h4>
                    <h4 class="sum">
                        <?php
                        $tienSum = $arr["Data"]["Tienthua"] - $arr["Data"]["Tienthang"];
                        if ($tienSum < 0) {
                            ?>
                            <?= $LANG["label"]["LOSS"]; ?> <font color="#ff4400"><?= number_format(-$tienSum, "0", ",", "."); ?> VNĐ</font>
                            <?php
                        } else if ($tienSum > 0) {
                            ?>
                            <?= $LANG["label"]["PROFIT"]; ?> <font color="#36D05D"><?= number_format($tienSum, "0", ",", "."); ?> VNĐ</font>
                            <?php
                        } else if ($tienSum = 0) {
                            ?>
                            <?= $LANG["label"]["DRAW"]; ?>
                            <?php
                        }
                        ?>

                    </h4>
                </div>
                <script>
                    var chartData = [
                        {label: "Tiền thu về", value: <?= $arr["Data"]["Tienthua"]; ?>, color: "#2C99B7", highlight: "#51B9D6"},
                        {label: "Tiền thua khách", value: <?= $arr["Data"]["Tienthang"]; ?>, color: "#DCDCDC", highlight: "#FFF"}
                    ];
                    var ctx = document.getElementById(chartTongTienChoiNew).getContext("2d");
                    new Chart(ctx).Pie(chartData, {
                        segmentStrokeColor: "rgba(255, 255, 255, 0.5)",
                        segmentStrokeWidth: 3
                    });
                </script>
            </div>
            <div class="caption">
                <?= $LANG["label"]["NUMBERMONEYPROFITFROMBETLOTTERY"]; ?>
            </div>
        </div>
        <?php
    }
    ?>
</div>